<template>
	<div>
		<TablePlus :columns="columns" :request-api="RequestMemberList">
			<template #headerimg="scope">
				<el-image :src="scope.row.headerimg" :lazy="true"></el-image>
			</template>
			<template #visittime="{ row }">
				<span>{{ dayjs(row.visittime).format('YYYY-MM-DD HH:mm:ss') }}</span>
			</template>
			<template #operation>
				<el-button type="primary" link :icon="View">查看</el-button>
				<el-button type="primary" link :icon="EditPen">编辑</el-button>
				<el-button type="primary" link :icon="Delete">删除</el-button>
			</template>
		</TablePlus>
	</div>
</template>

<script lang="ts" setup>
import TablePlus from '@/components/TablePlus/index.vue'
import { api } from '@/api'
import { Delete, EditPen, View } from '@element-plus/icons-vue'
import { dayjs } from 'element-plus'
const { RequestMemberList } = api
const columns = [
	{ prop: 'uid', label: '序号', width: 100 },
	{ prop: 'username', label: '会员名' },
	{ prop: 'headerimg', label: '头像' },
	{ prop: 'age', label: '年龄' },
	{ prop: 'visittime', label: '时间' },
	{ prop: 'operation', label: '操作', fixed: 'right', width: 330 }
]
</script>

<style lang="scss" scoped></style>
